/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 逆袭人生
 * Date: 2024-06-30
 * Time: 13:43
 */
public class Test {
    public static void main(String[] args) {
        String str = "hello";
        System.out.println(str);
        System.out.println(str.length());

        int a = 10;
        int b = 20;
        System.out.println("a= "+a + "b= "+b);
        System.out.println("a + b = "+a+b);//a + b = 1020
        System.out.println(a+b+"a + b ");//30a + b

    }
    public static void main6(String[] args) {
        int a = 10;
        long b = 20;

        //int c = a + b;
        long c = a + b;
        int c2 = (int)(a+b);

        byte f = 10;
        byte f2 = 20;

        //byte f3 = f + f2;
        int f4 = f + f2;
        byte f3 = (byte) (f + f2);
    }
    public static void main5(String[] args) {
        char a = 'A';
        char b = '张';
        System.out.println(a);
        System.out.println(b);

        boolean flg = true;
        System.out.println(flg);
    }
    public static void mainFloat(String[] args) {
        double d = 12.5;
        System.out.println(d);
        double a = 1.0;
        double b = 2.0;
        System.out.println(a / b);

        int c = 1;
        int e = 2;
        System.out.println(c*1.0 / e);

        double num = 1.1;
        System.out.println(num * num);//理解1.21

        float f = 12.5f;//12.5默认double类型8个字节,float是4个字节4<8直接赋值会报错所以12.5后加f
        System.out.println(f);
    }
    public static void mainShort(String[] args) {
        short a = 10;
        System.out.println(a);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);

        byte b =10;
        System.out.println(b);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }
    public static void mainLong(String[] args) {
        /**
         * 长整型
         *  8个字节
         *      63个bit位
         */
        long a = 10L;
        System.out.println(a);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);


    }
    public static void mainFun(String[] args) {
        int c;
        c = 2147483647;
        System.out.println(c);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
    }
}
